home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F24436_MakeDwg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-10  |  3.3 KB  |  105 lines

  1. /******************************************************************/
  2. /*                                                                */
  3. /*                      TurboCAD for Windows                      */
  4. /*                   Copyright (c) 1993 - 1999                    */
  5. /*             International Microcomputer Software, Inc.         */
  6. /*                            (IMSI)                              */
  7. /*                      All rights reserved.                      */
  8. /*                                                                */
  9. /******************************************************************/
  10. // MakeDwg.cpp : Defines the class behaviors for the application.
  11. //
  12.  
  13. #include "stdafx.h"
  14. #include "MakeDwg.h"
  15. #include "MDDialog.h"
  16.  
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CMakeDwgApp
  25.  
  26. BEGIN_MESSAGE_MAP(CMakeDwgApp, CWinApp)
  27.     //{{AFX_MSG_MAP(CMakeDwgApp)
  28.         // NOTE - the ClassWizard will add and remove mapping macros here.
  29.         //    DO NOT EDIT what you see in these blocks of generated code!
  30.     //}}AFX_MSG
  31.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  32. END_MESSAGE_MAP()
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CMakeDwgApp construction
  36.  
  37. CMakeDwgApp::CMakeDwgApp()
  38. {
  39.     // TODO: add construction code here,
  40.     // Place all significant initialization in InitInstance
  41. }
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // The one and only CMakeDwgApp object
  45.  
  46. CMakeDwgApp theApp;
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CMakeDwgApp initialization
  50.  
  51. BOOL CMakeDwgApp::InitInstance()
  52. {
  53.     // Initialize OLE libraries
  54.     if (!AfxOleInit())
  55.     {
  56.         AfxMessageBox(IDP_OLE_INIT_FAILED);
  57.         return FALSE;
  58.     }
  59.  
  60.     // Standard initialization
  61.     // If you are not using these features and wish to reduce the size
  62.     //  of your final executable, you should remove from the following
  63.     //  the specific initialization routines you do not need.
  64.  
  65. #ifdef _AFXDLL
  66.     Enable3dControls();            // Call this when using MFC in a shared DLL
  67. #else
  68.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  69. #endif
  70.  
  71.     // Parse the command line to see if launched as OLE server
  72.     if (RunEmbedded() || RunAutomated())
  73.     {
  74.         // Register all OLE server (factories) as running.  This enables the
  75.         //  OLE libraries to create objects from other applications.
  76.         COleTemplateServer::RegisterAll();
  77.  
  78.         // Application was run with /Embedding or /Automation.  Don't show the
  79.         //  main window in this case.
  80.         return TRUE;
  81.     }
  82.  
  83.     // When a server application is launched stand-alone, it is a good idea
  84.     //  to update the system registry in case it has been damaged.
  85.     COleObjectFactory::UpdateRegistryAll();
  86.  
  87.     CMakeDwgDlg dlg;
  88.     m_pMainWnd = &dlg;
  89.     int nResponse = dlg.DoModal();
  90.     if (nResponse == IDOK)
  91.     {
  92.         // TODO: Place code here to handle when the dialog is
  93.         //  dismissed with OK
  94.     }
  95.     else if (nResponse == IDCANCEL)
  96.     {
  97.         // TODO: Place code here to handle when the dialog is
  98.         //  dismissed with Cancel
  99.     }
  100.  
  101.     // Since the dialog has been closed, return FALSE so that we exit the
  102.     //  application, rather than start the application's message pump.
  103.     return FALSE;
  104. }
  105.